﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="HCFramework.Product.PropertyManage.Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register src="../CategoryManage/ChooseProductCategory.ascx" tagname="ChooseProductCategory" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="groupHeader">
        Property management
    </div>
    <div style="padding-bottom: 5px">
        <b>Category:</b> <uc1:ChooseProductCategory ID="ChooseProductCategory1" runat="server" />
        <asp:Button ID="btnFilter" runat="server" Text="Filter" 
            onclick="btnFilter_Click" />
    </div>
    <asp:Panel ID="PanelGrid" runat="server">
        <telerik:RadGrid ID="RadGridMain" runat="server" Skin="Office2007" AutoGenerateColumns="False"
            OnItemCommand="RadGridMain_ItemCommand" 
            OnPreRender="RadGridMain_PreRender" ShowFooter="True"
            AllowPaging="True" AllowSorting="True" GridLines="None" 
            AllowMultiRowSelection="True" onitemdatabound="RadGridMain_ItemDataBound">
            <ClientSettings>
                <Selecting AllowRowSelect="True" />
            </ClientSettings>
            <MasterTableView CommandItemSettings-AddNewRecordText="Thêm mới" NoMasterRecordsText="No records.">
                <RowIndicatorColumn>
                    <HeaderStyle Width="20px" />
                </RowIndicatorColumn>
                <ExpandCollapseColumn>
                    <HeaderStyle Width="20px" />
                </ExpandCollapseColumn>
                <CommandItemSettings AddNewRecordText="Thêm mới" />
                <Columns>
                    <telerik:GridClientSelectColumn UniqueName="column1">
                    </telerik:GridClientSelectColumn>
                    <telerik:GridBoundColumn DataField="ProductPropertyID" UniqueName="ProductPropertyID"
                        Visible="false">
                    </telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn HeaderText="Name" UniqueName="Name">
                        <ItemTemplate>
                            <asp:TextBox ID="txtName" AutoCompleteType="None" Width="100%" runat="server" Text='<%#Eval("Name")%>'></asp:TextBox>
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="txtName" AutoCompleteType="None" Width="100%" runat="server"></asp:TextBox>
                        </FooterTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn HeaderText="OrderDisplay" UniqueName="OrderDisplay">
                        <ItemTemplate>
                            <asp:TextBox ID="txtOrderDisplay" AutoCompleteType="None" Width="100%" runat="server"
                                Text='<%#Eval("OrderDisplay")%>'></asp:TextBox>
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="txtOrderDisplay" Text="1" AutoCompleteType="None" Width="100%" runat="server"></asp:TextBox>
                        </FooterTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn HeaderText="IsActive" UniqueName="IsActive">
                        <ItemTemplate>
                            <asp:CheckBox ID="chkIsActive" Checked='<%#Eval("IsActive")%>' runat="server" />
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:CheckBox ID="chkIsActive" Checked="true" runat="server" />
                            <asp:Button ID="btnAddNew" runat="server" Text="Insert" CommandName="Them"></asp:Button>
                        </FooterTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridHyperLinkColumn DataNavigateUrlFields="ProductPropertyID" 
                        DataNavigateUrlFormatString="~/Product/Admin/FilterManage/Default.aspx?propertyID={0}" Text="Filters" UniqueName="FilterLink">
                    </telerik:GridHyperLinkColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
        <div style="padding-top: 10px">
            <asp:LinkButton ID="LinkButtonUpdate" runat="server" CssClass="linkButton" OnClick="LinkButtonUpdate_Click">Update</asp:LinkButton>
            <asp:LinkButton ID="LinkButtonDelete" OnClientClick="return confirm('Are you sure?');"
                runat="server" CssClass="linkButton" OnClick="LinkButtonDelete_Click">Delete</asp:LinkButton>
        </div>
    </asp:Panel>
    <br />
    <b>Copy all property from category:</b> 
    <uc1:ChooseProductCategory ID="ChooseProductCategoryCopy" runat="server" />
    <asp:Button ID="btnCopyProperties" runat="server" Text="OK" 
        onclick="btnCopyProperties_Click" />
</asp:Content>